<template>
  <div class="swiper-container">
    <div class="swiper-wrapper">
      <slot></slot>
    </div>
    <!-- 分页器 -->
    <div class="swiper-pagination"></div>
  </div>
</template>

<script>
import Swiper from "swiper";
import "swiper/dist/css/swiper.css";

export default {
  props: {
    swiperOptions: {
      type: Object,
    },
  },
  mounted() {
    new Swiper(".swiper-container", this.swiperOptions);
  },
};
</script>

<style scoped lang="scss">
::v-deep .swiper-pagination {
  text-align: right;
  bottom: 5px;
  left: -8px;
}

::v-deep .swiper-pagination-bullet {
  width: 5px;
  height: 5px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  opacity: 1;
}

::v-deep .swiper-pagination-bullet-active {
  background: #fff;
}

.swiper-container {
  width: 100%;
  height: auto;
  padding: 0 0 30px;
  margin-left: auto;
  margin-right: auto;
}
.swiper-slide {
  text-align: center;
  font-size: 18px;

  /* Center slide text vertically */
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  transition-property: all;
}
</style>
